function lower_bound = kmeansBayesLowerboundLosses(mix, data, vars)


% E[ln p(Y|C, Z, mu)]
q1 = ElnpY_CZmu_losses(mix, data, vars);

% E[ln p(Z|pi)]
q2 = ElnpZ_pi_losses(mix, vars);

% E[ln p(pi)]
q3 = Elnppi_losses(mix);

% E[ln p(mu)]
q4 = Elnpmu_losses(mix);

% E[ln q(Z)]
q5 = ElnqZ_losses(vars);

% E[ln q(pi)]
q6 = Elnqpi_losses(mix);

% E[ln q(mu)]
q7 = Elnqmu_losses(mix);


lower_bound = q1 + q2 + q3 + q4 - q5 - q6 - q7;



% lower_bound
% 
% [mix2 vars2] = killComponents(mix, vars, 5);
% ll = kmeansBayesLowerbound(mix2, data, vars2)
% 
% [mix2 vars2] = killComponents(mix, vars, 3);
% ll = kmeansBayesLowerbound(mix2, data, vars2)
% 
% pause
